package models.dao;

import java.util.Calendar;
import java.util.Date;
import java.util.List;

import models.Food;
import play.db.jpa.GenericModel.JPAQuery;

public class FoodDAO {

	public static List<Food> getTodayFoodList()
	{
		Calendar cal = Calendar.getInstance();
		Date date;
		if(cal.get(Calendar.HOUR_OF_DAY)>=13)
		{
			cal.add(Calendar.DATE, 1);
			date =cal.getTime();
		}
		date = cal.getTime();
		
		JPAQuery query =  Food.find("add_date = ?", date);
		
		return query.fetch();
	}
}
